<template>
  
   <tr>
      <td><input type="checkbox" v-model="obj.checked" /></td>
      <td>{{obj.name}}</td>
      <td>{{obj.price}}</td>
      <td><button @click="addFn(index)">+</button>{{obj.num}}<button @click="minusFn(index)">-</button></td>
      <td>{{obj.price*obj.num}}</td>
      <td><button @click="delFn(index)">删除</button></td>
    </tr>
  

</template>

<script>
export default {
  props: ['obj','index'],
  methods: {
    delFn(index){
    this.$emit('del',index)
    },
    addFn(index){
      this.$emit('add',index)
    },
    minusFn(index){
     
      this.$emit('minus',index)
    },
  }
}
</script>

<style>

td{
  border: 1px black solid;
  text-align: center;
  width: 200px;
}
</style>
